{% extends 'base.html' %}
{% load staticfiles %}
{% block custom_css %}
    <link href="{% static 'css/common.css' %}" type="text/css" rel="stylesheet">
    <link href="{% static 'css/index.css' %}" type="text/css" rel="stylesheet">

    <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/bootstrap-fileinput.css' %}" rel="stylesheet">
{% endblock %}
{% block content %}
    <div class="about_banner">
        <div class="container">
            <h2>Shortcodes</h2>
            <span class="breadcrumbs"><a href="index.html"><i class="fa fa-home home_1"></i></a> / <a href="news.html"
                                                                                                      class="home_desc">News</a> / <span>Shortcodes</span></span>
        </div>
    </div>
    <div class="about_top">
        <div class="container">
            <div class="col-md-3 column-1 column-13">
                <i class="fa fa-envelope-o envelop"></i>
                <address class="address">
                    <p>项目得分</p>
                    <dl>
                        <dt></dt>
                        <dd>Freephone :&nbsp;<span> +1 800 254 2478</span></dd>
                        <dd>Telephone :&nbsp;<span> +1 800 547 5478</span></dd>
                        <dd>FAX :&nbsp;<span>+1 800 658 5784</span></dd>
                        <dd>提交项目后获得项目评分</dd>

                    </dl>
                </address>

            </div>
            <div class="col-md-9 column-15">
                <h4 class="m_11" style="text-align: center;">项目制作</h4>
                <div class="content-inner_1">
                    <div class="row">
                        <div class="col-md-3">
                            <h3>项目描述：</h3>
                        </div>
                    </div>
                    <p>&nbsp;</p>
                    <div class="row">
                        <div class="col-md-12">
                            <h5>完成项目素材中的SQL练习，并将编写的SQL文件和运行截图保存,打包后作为作业提交。<br>
                                设计一个学生成绩数据库，该库包含学生，老师，课程和成绩等信息并完成后面的练习(注意主外键关系)。<br>
                                学生：学号（SNO）、姓名(SNAME)、性别(SSEX)、生日(SBIRTHDAY )、所属班级(CLASS )<br>
                                课程：课程编号(CNO)、课程名(CNAME)、授课老师(TNO)<br>
                                成绩：学号(SNO)、课程编号(CNO)、得分(DEGREE)<br>
                                老师：教师编号(TNO)、教师姓名(TNAME)、性别(TSSEX)、生日(TBIRTHDAY)、职称(TITLE)、单位科室（DEPART）<br>
                                要求：<br>
                                一、每张表使用SQL语句插入至少10条数据。</h5>
                        </div>
                    </div>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>

                    <div class="row" style="margin-top: 50px;">
                        <div class="col-md-12">
                            <div class="alert alert_1" role="alert"
                                 style=" color: #ffffff; border-color: #a3da36; background-color: #a3da36;">
                                <i class="fa fa-folder-open"></i>
                                项目源码下载
                                <span style="position: absolute;right: 40px;"><a href="" data-toggle="modal"
                                                                                 data-target=""
                                                                                 style="text-decoration: none;color: #ffffff"><i
                                        class="fa fa-arrow-circle-o-down fa-lg"></i></a></span>
                            </div>
                        </div>
                    </div>

                    <div class="row" style="margin-top: 80px;">
                        <div class="col-md-4 col-md-offset-8">
                            <a href="#" class="add_btn more_btn" id="uploadSubmit" data-toggle="modal"
                               data-target="#teacher-comment">教师点评</a>
                        </div>
                    </div>

                    <div class="modal fade" id="teacher-comment" tabindex="-1" role="dialog"
                         aria-labelledby="applyModalLabel"
                         aria-hidden="true">
                        <div class="modal-dialog modal-dialog_2">
                            <div class="modal-content" style="width: 450px;">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                            aria-hidden="true">×</span></button>
                                    <h5 class="modal-title" id="myModalLabel">
                                        <div class="head_4">
                                            <p>教师点评</p>
                                        </div>
                                    </h5>
                                </div>
                                <div class="modal-body">
                                    <form class="register" id="jsStayForm">
                                        <div class="section">
                                            <div class="row">
                                                <div class="col-md-12" style="text-align: center;">
                                                    <h4><i class="fa fa-file fa-lg" aria-hidden="true"></i>
                                                        <span>Python遗传算法的解释</span></h4>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="section" style="text-align: center;">
                                            需要积分：<span
                                                style="color: #d58512;">200</span>&nbsp;&nbsp;&nbsp;&nbsp;点评个数：<span
                                                style="color: #d58512;">8</span>
                                        </div>
                                        <div class="section" style="text-align: center;">
                                            <div><a href="{% url 'course:program_commit' course_id lesson_id program_id %}"><input
                                                    type="button" id="jsStayBtn" value="兑换"
                                                    class="btn btn-warning"></a></div>
                                        </div>
                                        <ul class="new">
                                            <li class="new_left"><p><a href="#">积分不够 ?</a></p></li>
                                            <li class="new_right"><p class="sign"><a href="#"
                                                                                     data-toggle="modal"
                                                                                     data-target="#applyModal_1">点击充值</a>
                                            </p></li>
                                            <div class="clearfix"></div>
                                        </ul>
                                        {% csrf_token %}
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
{% endblock %}

{% block custom_js %}
    <script src="{% static 'js/imgUp.js' %}"></script>

    <script src="{% static 'js/bootstrap-fileinput.js' %}"></script>

    <script>
        //   上传附件到方法
        function FileUpload() {
            var form_data = new FormData();
            var file_info1 = $('#programfile')[0].files[0];
            var file_info2 = $('#picID')[0].files[0];
            var learned = $('#learned').val();

            form_data.append('file', file_info1);
            form_data.append('image', file_info2);
            form_data.append('learn', learned);
            form_data.append('programId', {{ program_id }});

            alert(form_data.get('learn'));

            if (file_info1 == undefined) {//暂且不许要判断是否有附件
                alert('你没有选择任何文件');
                return false;
            }
            if (file_info2 == undefined) {//暂且不许要判断是否有附件
                alert('你没有选择项目截图');
                return false;
            }

            // 提交ajax的请求
            $.ajax({
                url: "{% url 'course:program_upload' %}",
                type: 'POST',
                data: form_data,
                //data: {"form_data":form_data, "learned":learned},
                processData: false,  // tell jquery not to process the data
                contentType: false, // tell jquery not to set contentType
                beforeSend: function (xhr, settings) {
                    xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
                },
                success: function (callback) {

                    console.log(order_id)
                }
            }); // end ajax
        }

    </script>
{% endblock %}




